#!/bin/bash
#FIXME: Não executar esse script mais de uma vez dentro de um período de 2 minutos, vide Socket TIME_WAIT.
./sockets -s 50000 > server.out &
(sleep 1 && ssh ciclope "./sockets -i x-men 50000 50001" > node1.out) &
(sleep 1 && ssh wolverine "./sockets -i x-men 50000 50002" > node2.out) &
(sleep 2 && ssh magneto "./sockets -i ciclope 50001 50003" > node3.out) &
(sleep 2 && ssh hulk "./sockets -i ciclope 50001 50004" > node4.out) &
(sleep 2 && ssh colossus "./sockets -i wolverine 50002 50005" > node5.out) &
(sleep 2 && ssh tempestade "./sockets -i wolverine 50002 50006" > node6.out) &
(sleep 3 && ssh demolidor "./sockets -c magneto 50003" > client1.out) &
(sleep 3 && ssh venon "./sockets -c magneto 50003" > client2.out) &
(sleep 3 && ssh vampira "./sockets -c hulk 50004" > client3.out) &
(sleep 3 && ssh gambit "./sockets -c hulk 50004" > client4.out) &
(sleep 3 && ssh elektra "./sockets -c colossus 50005" > client5.out) &
(sleep 3 && ssh anjo "./sockets -c colossus 50005" > client6.out) &
(sleep 3 && ssh justiceiro "./sockets -c tempestade 50006" > client7.out) &
(sleep 3 && ssh noturno "./sockets -c tempestade 50006" > client8.out)

